<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['环卫管理','系统管理','二维码管理[站点]']" icon="fa fa-cube" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>

	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
					<h2>二维码管理[站点]</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">
								<sa-company-tree-car companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree-car>
								<button type="button" class="btn btn-primary" (click)="downloadCarCode(ImgModal,'carNumber')">二维码下载[车辆]</button>
								<button type="button" class="btn btn-primary" (click)="add()">新增站点信息</button>
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="searchVal" (change)="search_data()" class="search-input" placeholder="站点、区域">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="search_data()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>站点名称</th>
										<th>区域名称</th>
										<th>地址</th>
										<th>坐标点</th>
										<th>更新时间</th>
										<th>更新人员</th>
										<th>二维码下载[站点]</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData; let i = index" [attr.data-index]="i"  >
										<td>{{row.stationName}}</td>
										<td>{{row.areaName}}</td>
										<td>{{row.stationAddress}}</td>
										<td>
											<span *ngIf="row.longitude&&row.lantitude"> {{row.longitude}},{{row.lantitude}}</span>
										</td>
										<td>{{row.uploadTime}}</td>
										<td>{{row.uploadUserName}}</td>
										<td>
											<button type="button" (click)="downloadCarCode(ImgModal,row)" >下载</button>
										</td>
										<td>
											<button type="button" (click)="editRow(row)" >编辑</button>
											<button type="button" (click)="delRow(row)" >删除</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator 
								[totalRecords]="totalCount" 
								[rows]="pageSize" 
								[currentPage]="curPage - 1" 
								(onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
	<div style="text-align: center;font-weight: bold;font-size: 18px;position: absolute;left: -9999px;top: 0;" id="qrcodeBox">
		<div id="qrcode" style="width: 584px;"></div>
		<div *ngIf="downloadType == 'car'" style="margin-top: 8px;">
			<p><span>车牌号码: </span><span>{{carNumber}}</span></p>
			<p><span>设备ID: </span><span>{{deviceId}}</span></p>
		</div>
		<div *ngIf="downloadType == 'site'" style="margin-top: 8px;">
			<p><span>站点名称: </span><span>{{downloadRow.stationName}}</span></p>
			<p><span>区域名称: </span><span>{{downloadRow.areaName}}</span></p>
			<p><span>地址: </span><span>{{downloadRow.stationAddress}}</span></p>
		</div>
	</div>
	
	<!-- 图片查看   弹窗-->
	<section bsModal #ImgModal="bs-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" (click)="imgClose(ImgModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>     
					<h4 class="modal-title">二维码图片</h4>
				</div>
				<div class="modal-body">
					<!--<div class="form-horizontal">-->
						<div id="qrcodeImg">
							<!--<img src="" alt="" id="qrcodeImg" style="width: 584px;height: auto;"/>-->
						</div>
					<!--</div>-->
				</div>
			</div>
		</div>
	</section>
	<!-- 图片查看 弹窗end-->
	
</div>